using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AdventureWorks.Cinema.SharedBusinessLogic;

public partial class Registration : System.Web.UI.Page
{
    /// <summary>
    /// Speichert die Vor- und Nachnamen.
    /// </summary>    
    protected void CreateuserWizard_CreatedUser(object sender, EventArgs e)
    {        
        CinemaBusiness business =
                       HttpContext.Current.Session["BusinessLogic"] 
                       as CinemaBusiness;
                              
        TextBox FirstName = 
            (TextBox)this.CreateUserWizardStep1
            .ContentTemplateContainer.FindControl("FirstName");

        TextBox LastName = 
            (TextBox)this.CreateUserWizardStep1
            .ContentTemplateContainer.FindControl("LastName");

        business.Customers.CurrentCustomer.FirstNames = FirstName.Text;
        business.Customers.CurrentCustomer.LastName = LastName.Text;

        business.Customers.Update(business.Customers.CurrentCustomer);
    }
}
